//
//  SaveSceneApi.m
//  MicrowaveLight
//
//  Created by Kendama on 2017/6/19.
//  Copyright © 2017年 DT. All rights reserved.
//

#import "SaveSceneApi.h"

@implementation SaveSceneApi{
    NSDictionary *_dic;
}

- (id)initWithDictionary:(NSDictionary *)dic{
    if (self = [super init]) {
        _dic = dic;
    }
    return self;
}

- (NSString *)requestUrl {
    return @"wblight/scene/save";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
    NSMutableDictionary *dic=[NSMutableDictionary getPubdic];
    if (_dic[@"id"]) {
        [dic setObject:_dic[@"id"] forKey:@"id"];
        
    }
    if (_dic[@"name"]) {
        [dic setObject:_dic[@"name"] forKey:@"name"];
        
    }
    if (_dic[@"device_id"]) {
        [dic setObject:_dic[@"device_id"] forKey:@"device_id"];
        
    }
    if (_dic[@"r"]) {
        [dic setObject:_dic[@"r"] forKey:@"r"];
        
    }
    if (_dic[@"g"]) {
        [dic setObject:_dic[@"g"] forKey:@"g"];
        
    }
    if (_dic[@"b"]) {
        [dic setObject:_dic[@"b"] forKey:@"b"];
        
    }
    if (_dic[@"brightness"]) {
        [dic setObject:_dic[@"brightness"] forKey:@"brightness"];
        
    }
    if (_dic[@"colour_temperature"]) {
        [dic setObject:_dic[@"colour_temperature"] forKey:@"colour_temperature"];
        
    }
    if (_dic[@"twinkle"]) {
        [dic setObject:_dic[@"twinkle"] forKey:@"twinkle"];
        
    }
    
    
    NSString *sign=[NSString getSign:dic];
    [dic setObject:sign forKey:@"sign"];
    return dic;
}

- (NSString *)userId {
    return [[[self responseJSONObject] objectForKey:@"userId"] stringValue];
}


-(void)dealloc
{
    NSLog(@"%@ dealloc",[self class]);
}

@end
